<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
	<f:loadBundle var="messages" basename="messages" />

	<head>
	<title>#{messages['conteudoList.title']}</title>
	<style type="text/css">
@import
	url(#{facesContext.externalContext.requestContextPath}/styles/myfaces.css)
	;
</style>
	</head>



	<!-- Error from this table is caused by http://issues.apache.org/jira/browse/TOMAHAWK-466 -->
	<t:dataTable id="conteudos" var="conteudo" style="margin-top: 10px"
		value="#{conteudoList.conteudos}" rows="25"
		sortColumn="#{conteudoList.sortColumn}"
		sortAscending="#{conteudoList.ascending}"
		styleClass="scrollerTable table" headerClass="standardTable_Header"
		rowClasses="standardTable_Row1,standardTable_Row2"
		columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnCentered">
		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="id" arrow="true">
					<h:outputText value="#{messages['conteudo.id']}" />
				</t:commandSortHeader>
			</f:facet>
			<h:form id="editConteudo">
				<h:commandLink action="#{conteudoForm.edit}" value="#{conteudo.id}">
					<f:param name="id" value="#{conteudo.id}" />
				</h:commandLink>
			</h:form>
		</t:column>

		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="id" arrow="true">
					<h:outputLabel value="Avaliar" />
				</t:commandSortHeader>
			</f:facet>
			<h:form id="avaliarConteudo">
				<h:commandLink action="#{avaliacaoForm.avaliar}"
					value="#{conteudo.id}">
					<f:setPropertyActionListener target="#{avaliacaoForm.conteudoId}"
						value="#{conteudo.id}" />
				</h:commandLink>
			</h:form>
		</t:column>

		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="titulo" arrow="true">
					<h:outputText value="#{messages['conteudo.titulo']}" />
				</t:commandSortHeader>
			</f:facet>
			<h:outputText value="#{conteudo.titulo}" />
		</t:column>
		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="descricao" arrow="true">
					<h:outputText value="#{messages['conteudo.descricao']}" />
				</t:commandSortHeader>
			</f:facet>
			<h:outputText value="#{conteudo.descricao}" />
		</t:column>
		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="tags" arrow="true">
					<h:outputText value="#{messages['conteudo.tags']}" />
				</t:commandSortHeader>
			</f:facet>
			<h:outputText value="#{conteudo.tags}" />
		</t:column>
		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="url" arrow="true">
					<h:outputText value="#{messages['conteudo.url']}" />
				</t:commandSortHeader>
			</f:facet>
			<h:outputText value="#{conteudo.url}" />
		</t:column>
		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="datacriacao" arrow="true">
					<h:outputText value="#{messages['conteudo.dataCriacao']}" />
				</t:commandSortHeader>
			</f:facet>
			<h:outputText value="#{conteudo.dataCriacao}" />
		</t:column>
		<t:column>
			<f:facet name="header">
				<t:commandSortHeader columnName="datatualizacao" arrow="true">
					<h:outputText value="#{messages['conteudo.ultimaAtualizacao']}" />
				</t:commandSortHeader>
			</f:facet>
			<h:outputText value="#{conteudo.ultimaAtualizacao}" />
		</t:column>
	</t:dataTable>

	<ui:include src="/tableFooter.xhtml">
		<ui:param name="tableName" value="conteudos" />
	</ui:include>

	<script type="text/javascript">
    highlightTableRows("editConteudo:conteudos");
</script>

</f:view>
</html>
